package com.hctforgreen.greenservice.utils;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

/**
 * 资料刷新数据时间
 * 
 * @author denghb
 * 
 */
public class EntryCataStoreUtil {

	public static String get(Activity activity) {
		SharedPreferences sharedPreferences = activity.getSharedPreferences(
				HctConstants.BOOK_REFRESH_DATA_STORE_FILE_NAME,
				Context.MODE_WORLD_WRITEABLE);
		String date = sharedPreferences.getString(
				HctConstants.BOOK_REFRESH_DATA_STORE_KEY_VALUE, "");
		return date;
	}

	public static void save(Activity activity, String date) {
		SharedPreferences sharedPreferences = activity.getSharedPreferences(
				HctConstants.BOOK_REFRESH_DATA_STORE_FILE_NAME,
				Context.MODE_WORLD_WRITEABLE);
		Editor editor = sharedPreferences.edit();

		editor.putString(HctConstants.BOOK_REFRESH_DATA_STORE_KEY_VALUE, date);
		editor.commit();
	}

}
